package demo.thread;

public class PriorityDemo implements Runnable {
    public void run() {
        for(int i=0;i<5;++i){
            System.out.println(Thread.currentThread().getName()+"运行"+i);
        }
    }
 
    public static void main(String[] args) {
    	PriorityDemo r = new PriorityDemo();
        Thread t1=new Thread(r,"A");
        Thread t2=new Thread(r,"B");
        Thread t3=new Thread(r,"C");
        t1.setPriority(8);
        t2.setPriority(2);
        t3.setPriority(6);
        t1.start();
        t2.start();
        t3.start();
         
    }
}
